package cn.taoticket.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.taoticket.mapper.TaoticketCinemaMapper;
import cn.taoticket.pojo.TaoticketCinema;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by taoticket
 */
@RestController
public class RestTaoticketCinemaService {

    @Resource
     private TaoticketCinemaMapper taoticketCinemaMapper;

     @RequestMapping(value = "/getTaoticketCinemaById",method = RequestMethod.POST)
     public TaoticketCinema getTaoticketCinemaById(@RequestParam("id") Long id)throws Exception{
        return taoticketCinemaMapper.getTaoticketCinemaById(id);
     }

     @RequestMapping(value = "/getTaoticketCinemaListByMap",method = RequestMethod.POST)
     public List<TaoticketCinema>	getTaoticketCinemaListByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketCinemaMapper.getTaoticketCinemaListByMap(param);
     }

     @RequestMapping(value = "/getTaoticketCinemaCountByMap",method = RequestMethod.POST)
     public Integer getTaoticketCinemaCountByMap(@RequestParam Map<String,Object> param)throws Exception{
        return taoticketCinemaMapper.getTaoticketCinemaCountByMap(param);
     }

     @RequestMapping(value = "/qdtxAddTaoticketCinema",method = RequestMethod.POST)
     public Integer qdtxAddTaoticketCinema(@RequestBody TaoticketCinema taoticketCinema)throws Exception{
        taoticketCinema.setCreatedTime(new Date());
        return taoticketCinemaMapper.insertTaoticketCinema(taoticketCinema);
     }

     @RequestMapping(value = "/qdtxModifyTaoticketCinema",method = RequestMethod.POST)
     public Integer qdtxModifyTaoticketCinema(@RequestBody TaoticketCinema taoticketCinema)throws Exception{
        taoticketCinema.setUpdatedTime(new Date());
        return taoticketCinemaMapper.updateTaoticketCinema(taoticketCinema);
     }
}
